package com.zh.zhbootauth.service;

import com.zh.zhbootauth.service.fallback.UserFallBackFactory;
import com.zh.zhbootcommon.domain.DResult;
import com.zh.zhbootcommon.entity.user.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 描述: 用户Feign
 *
 * @author: yanglin
 * @Date: 2021-10-29-21:08
 * @Version: 1.0
 */
@FeignClient(value = "zh-boot-business", fallbackFactory = UserFallBackFactory.class)
public interface UserClient {

    /**
     * 根据用户ID查询用户
     * @param userId
     * @return
     */
    @PostMapping("/u/v1/queryUserOne")
    DResult<User> queryUserOne(@RequestParam int userId);

    /**
     * 根据用户账户查询用户
     * @param user
     * @return
     */
    @PostMapping("/u/v1/queryUserInfo")
    DResult<User> queryUserInfo(@RequestBody User user);
}
